package enterprises

class Enterprise {

    static constraints = {
		name(blank:false, minSize:3, unique:true)
		registrationNumber(unique:true, min:1)
		address(nullable:true)
		telephone(nullable:true)
		fax(nullable:true)
		countWorkers(min:0)
		manCount(min:0)
		womenCount(min:0)
		itrCount(min:0)
		summaryArea(min:0.0)
		freeArea(min:0.0)
		busyArea(min:0.0)
		possibleBuildingArea(min:0.0)
		productions(nullable:true)
		providers(nullable:true)		
    }
	
	static hasMany = [productions:Production, providers:Provider]
	
	static belongsTo =  [IndustrialSector, TypeOwnership, Provider]
	IndustrialSector industrialSector
	TypeOwnership typeOwnership
	
	
	Integer registrationNumber
	String name
	String address
	String telephone
	String fax
	Integer countWorkers = 0
	Integer manCount = 0
	Integer womenCount = 0
	Integer itrCount = 0
	BigDecimal summaryArea = 0.0
	BigDecimal freeArea = 0.0
	BigDecimal busyArea = 0.0
	BigDecimal possibleBuildingArea = 0.0



	@Override
	public String toString() {
		name;
	}	
		
}
